<template>
	<view>
		<u-list style='height: 600rpx;'>
			<u-list-item
				v-for="(item, index) in indexList"
				:key="index"
				
			>
				<u-cell :title="item.title" @click='$u.route(`/pages/me/${item.key}`)'>
				</u-cell>
			</u-list-item>
		</u-list>
		<u-button @click='logOut'>退出登录</u-button>
	</view>
</template>

<script>
import { mapMutations } from 'vuex'
export default{
	data () {
		return {
			indexList: [
				{title:'个人信息',key:'userinfo'},
				{title:'账号设置',key:''},
				{title:'关于我们'},
				{title:'用户协议'},
				{title:'隐私协议'},
			],
		}
	},
	methods:{
		...mapMutations(['clearUser']),
		//退出登录
		logOut(){
			this.clearUser();
			uni.switchTab({
				url:'/pages/index/index'
			})
		}
	}
}
</script>
